package cn.shengongying.api.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;

/**
 * author: RXK
 * date: 2022/1/5 星期三
 * desc:
 */
@Configuration
@Profile({"!prod"})
public class SwaggerConfig {

    @Bean
    public Docket docket() {
        return new Docket(DocumentationType.OAS_30)
                .enable(true)
                .useDefaultResponseMessages(false)
                .apiInfo(ApiInfo.DEFAULT)
                .groupName("Android API")
                .select()
                .apis(RequestHandlerSelectors.basePackage("cn.shengongying.api.controller"))
                .paths(PathSelectors.ant("/**"))
                .build()
                ;
    }


}
